package com.ruoyi.job.task;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.job.fallbackFactory.RemoteSystemAppService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

/**
 * 定时任务调度测试
 * 
 * @author ruoyi
 */
@Component("ryTask")
@Lazy
public class RyTask
{
    private static Logger log = LoggerFactory.getLogger(RyTask.class);
    @Autowired
    private RemoteSystemAppService remoteSystemAppService;

    public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i)
    {
        System.out.println(StringUtils.format("执行多参方法： 字符串类型{}，布尔类型{}，长整型{}，浮点型{}，整形{}", s, b, l, d, i));
    }

    public void ryParams(String params)
    {
        System.out.println("执行有参方法：" + params);
    }

    public void ryNoParams() {
        System.out.println("执行无参方法");
    }

    /**
     * 入口
     * 定时自动开奖（未开红包），未开奖的用户自动开奖(凌晨之前)
     */
    public void timingLottery(){
        remoteSystemAppService.timingLottery(SecurityConstants.INNER);
    }
    /**
     * 入口
     * 开始开团
     */
    public void startGroup(Integer groupId){
        remoteSystemAppService.startGroup(groupId.longValue(),SecurityConstants.INNER);
    }

    /**
     *
     * 入口
     * 释放拼团基金奖励（订购奖励）（48小时后释放）
     * 每天只能释放一半，待完善
     */
    public void freedOrderRewards(){
        remoteSystemAppService.freedOrderRewards(SecurityConstants.INNER);
    }


    /**
     * 入口
     * 1.总产值释放到ftc小、pc入口
     * 2.插入初始化拼团结果信息
     */
    public void grossOutputMain(){
        remoteSystemAppService.grossOutputMain(SecurityConstants.INNER);
    }

    /**
     * 入口
     * 凌晨0点初始化操作
     */
    public void beforeDawnInit(){
        remoteSystemAppService.beforeDawnInit(SecurityConstants.INNER);
    }
    /**
     * 入口
     * 自动挂卖ftc大(开启ftc自动挂卖，开启任务定时)
     */
    public void automaticListingExecute(){
        remoteSystemAppService.automaticListingExecute(SecurityConstants.INNER);
    }

    /**
     * 入口
     * ftc自动回收
     */
    public void automaticRecycling(){
        remoteSystemAppService.automaticRecycling(SecurityConstants.INNER);
    }
    /**
     * 入口
     * 计算满额账户
     */
    public void fullAccountInit(){
        remoteSystemAppService.fullAccountInit(SecurityConstants.INNER);
    }

    /**
     * 入口
     * 计算团队考核
     */
    public void teamExamineInit(){
        remoteSystemAppService.teamExamineInit(SecurityConstants.INNER);
    }

    /**
     * 入口
     * 团队奖励结算收益
     */
    public void teamRewardSettlementInit(){
        remoteSystemAppService.teamRewardSettlementInit(SecurityConstants.INNER);
    }
}
